﻿using CPPEI.Coolzon.Designer.Event.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.Designer.Views
{
    public partial class StatusView
    {
        [Common.Subscribe]
        public void OnUIDesignMouseUpdate(UIDesignMouseUpdateEvent @event)
        {
            pointStatus.Content = string.Format("{0},{1} ",
                Floor(@event.PointInCanvasX), Floor(@event.PointInCanvasY));

            startStatus.Content = string.Format("起点：{0},{1} ",
                Floor(@event.DesignStartX), Floor(@event.DesignStartY));

            sizeStatus.Content = string.Format("大小：{0},{1} ",
                Floor(@event.DesignWidth), Floor(@event.DesignHeight));
        }

        [Common.Subscribe]
        public void OnPartInstanceSelected(UISelectPartInstanceEvent @event)
        {
            if (@event.PartInstance != null)
            {
                partInfo.Content = (@event.PartInstance as Coolzon.UI.Part).Name;
            }
        }
    }
}
